<?php
// require_once "./init.php";
define("dir",dirname(dirname(dirname(__FILE__)))."/");
define("plugDir",dirname(dirname(dirname(__FILE__)))."/plugins/system/");
require_once "". plugDir ."md5.php";

echo '<b>Checking Modified Files...</b> <br />';

$aDisallow = array
(
	'include/settings/backup/phpfox-settings.php',
	'include/settings/backup/mysql.structure.php',
	'include/settings/version.php'
);

$i = 0;
foreach($checksum as $var => $value)
{
	$sFile = dir . $var;
 	if ( file_exists($sFile) && is_file($sFile) && !in_array($var, $aDisallow) )
 	{
 		if ( md5(str_replace("\r\n", "\n", file_get_contents($sFile))) != $value )
 		{
 	 		$i++;
 			echo "$var = <span style=\"color:red;\">MODIFIED (". date("F d Y H:i:s", filemtime($sFile)) .")</span><br /><br />";
 		}
 	}
 	unset($sFile);
 	flush();
}
unset($checksum);

echo '<br /><strong>';
echo (!$i) ? 'No files have been modified.' : 'Certain files have been modified.';
echo '</strong>';

?>
